<include file="Public/min-header" />
<script type="text/javascript">
    window.UEDITOR_Admin_URL = "__ROOT__/Public/plugins/Ueditor/";
    var URL_upload = "{$URL_upload}";
    var URL_fileUp = "{$URL_fileUp}";
    var URL_scrawlUp = "{$URL_scrawlUp}";
    var URL_getRemoteImage = "{$URL_getRemoteImage}";
    var URL_imageManager = "{$URL_imageManager}";
    var URL_imageUp = "{$URL_imageUp}";
    var URL_getMovie = "{$URL_getMovie}";
    var URL_home = "{$URL_home}";
</script>
<load href="__ROOT__/Public/plugins/Ueditor/ueditor.config.js" />
<load href="__ROOT__/Public/plugins/Ueditor/ueditor.all.js" />
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<div class="wrapper">
    <include file="Public/breadcrumb" />
    <section class="content">
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default pull-right" data-original-title="返回"><i class="fa fa-reply"></i></a>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i>分类信息</h3>
                </div>
                <div class="panel-body">
                    <form action="{:U('cat/handle_cat')}" method="post" onsubmit="return checkUserUpdate(this);">
                        <table class="table table-bordered">
                            <tbody>
                                <tr>
                                    <td class="col-sm-1 text-right">分类名称:</td>
                                    <td>
                                        <input type="text" class="form-control" name="cat_name" value="{$info.cat_name}">
                                    </td>
                                    <td></td>
                                </tr>


                                <tr>
                                    <td class="col-sm-1 text-right">排序:</td>
                                    <td>
                                        <input type="text" class="form-control" name="sort_order" value="{$info.sort_order}">
                                    </td>
                                    <td>数值小的，越靠前</td>
                                </tr>



                                <tr>
                                <td class = "text-right">是否显示:</td>
                                <td>
                            <input name="is_show" type="radio" value="1" <if condition="$info['is_show'] eq 1">checked</if> >是
                            <input name="is_show" type="radio" value="0" <if condition="$info['is_show'] eq 0">checked</if> >否
                            </td>
                            <td></td>
                            </tr>

                            </table>
                            </tr>
                            <tr>
                                <td></td>
                                <td>
                                    <input type="hidden" value="{$info.id}" name="id" />
                                    <input type="hidden" value="{$act}" name="act" />
                                    <button type="submit" class="btn btn-info">
                                        <i class="ace-icon fa fa-check bigger-110"></i> 保存
                                    </button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </form>
                </div>
            </div>
        </div>
    </section>
</div>
<script>
    function checkUserUpdate() {
//        var email = $('input[name="email"]').val();
        var cat_name = $('input[name="cat_name"]').val();


        var error = '';

//    if (!checkEmail(email)) {
//        error += "邮箱地址有误\n";
//    }
        if (!cat_name) {
            error += "分类名称不允许空值\n";
        }
        if (error) {
            layer.alert(error, {
                icon: 2
            });
            return false;
        }
        return true;

    }



</script>
</body>

</html>
